/*
 * 侧边栏模块
 * @Author: Chenliang(930225)
 * @Date: 2019-10-11 14:38:13
 * @LastEditors  : Chenliang(930225)
 * @LastEditTime : 2020-01-19 11:16:39
 */

import React, { Component } from 'react';
import { Menu } from 'antd';
import Link from 'umi/link';
import { connect } from 'dva';
const mapStateToProps = state => {
    return {
        pathname: state.routing.location.pathname
    };
};
class Task extends Component {
    constructor(props) {
        super(props);
        this.state = {
            defaultSelectedKeys: []
        };
    }
    componentDidMount() { }

    render() {
        const { pathname } = this.props;
        const select = [pathname.slice(1)]
        return (
            <div className="sidebar">
                <Menu mode="inline" selectedKeys={select}>
                    <Menu.Item key="login">
                        <Link to="login">登录</Link>
                    </Menu.Item>
                    <Menu.Item key="report">
                        <Link to="report">案例征集</Link>
                    </Menu.Item>
                </Menu>
            </div>
        );
    }
}
export default connect(mapStateToProps)(Task);